using System;
using System.Collections.Generic;
using System.Text;
using WindowsLive.Writer.Api;

namespace Watchwords
{
    class WatchwordSettings
    {
        private IProperties _properties;
        public WatchwordSettings( IProperties properties )
		{
			_properties = properties;
		}

		public string Language
		{
            get
            {
                return _properties.GetString ( LANGUAGE, String.Empty );
            }
            set
            {
                _properties.SetString ( LANGUAGE, value );
            }
		}
		private const string LANGUAGE = "Language" ;

        public string CacheLanguage
        {
            get
            {
                return _properties.GetString ( CACHELANGUAGE, String.Empty );
            }
            set
            {
                _properties.SetString ( CACHELANGUAGE, value );
            }
        }
        private const string CACHELANGUAGE = "CacheLanguage";

        public DateTime CacheDate
        {
            get
            {
                return DateTime.Parse( _properties.GetString ( CACHEDATE, DateTime.MinValue.ToShortDateString() ));
            }
            set
            {
                _properties.SetString ( CACHEDATE, value.ToShortDateString() );
            }
        }
        private const string CACHEDATE = "CacheDate";

        public string CacheString
        {
            get
            {
                return _properties.GetString ( CACHESTRING, String.Empty );
            }
            set
            {
                _properties.SetString ( CACHESTRING, value );
            }
        }
        private const string CACHESTRING = "CacheString";
    }
}
